<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

	<rich:modalPanel id="editLegalPersonDlg" minWidth="450" minHeight="350" zindex="15500">
		<f:facet name="header">
			<h:outputText value="Agregar Persona Juridica" />
		</f:facet>

		<f:facet name="controls">
			<h:panelGroup>
				<h:graphicImage id="hideEditLegalPersonDlg" value="/img/close.png"
					styleClass="hidelink" />
				<rich:componentControl for="editLegalPersonDlg"
					attachTo="hideEditLegalPersonDlg" operation="hide" event="onclick" />
			</h:panelGroup>
		</f:facet>

		<h:form id="frmEditLegalPerson">
			<h:panelGroup rendered="#{legalPersonHelper.selected != null}">
				<h:panelGrid columns="2" width="100%">
					<h:outputText value="RTN: " />
					<h:inputText value="#{legalPersonHelper.selected.rtn}" readonly="#{not legalPersonHelper.editing}" style="width:100%"/>

					<h:outputText value="Nombre: " />
					<h:inputText value="#{legalPersonHelper.selected.name}" readonly="#{not legalPersonHelper.editing}" style="width:100%"/>
				</h:panelGrid>
				<br />
				<h:panelGrid columns="1" width="100%">
					<h:outputText value="Direccion: " />
					<h:inputTextarea
						value="#{legalPersonHelper.selected.addressDescription}"
						readonly="#{not legalPersonHelper.editing}"
						style="width:100%" rows="5">
					</h:inputTextarea>
				</h:panelGrid>
				<br />
				<h:panelGrid columns="4" width="100%">
					<h:outputText value="Telefono(s): " />
					<h:inputText
						value="#{legalPersonHelper.selected.phones}"
						readonly="#{not legalPersonHelper.editing}">
					</h:inputText>

					<h:outputText value="email(s): " />
					<h:inputText
						value="#{legalPersonHelper.selected.emails}"
						readonly="#{not legalPersonHelper.editing}">
					</h:inputText>
				</h:panelGrid>
			</h:panelGroup>

			<br />
			<br />
			<br />

			<div align="center">
				<h:panelGroup rendered="#{legalPersonHelper.editing}">
					<a4j:commandButton value="#{messages['button.ok']}"
						action="#{legalPersonHelper.saveSelected}"
						reRender="frmLegalPersonGrid"
						oncomplete="if (#{facesContext.maximumSeverity == null}) #{rich:component('editLegalPersonDlg')}.hide(); else #{rich:component('msgPanel')}.show();">
					</a4j:commandButton>
					<button
						onclick="#{rich:component('editLegalPersonDlg')}.hide();"
						type="button">
						#{messages['button.cancel']}
					</button>
				</h:panelGroup>
				<h:panelGroup rendered="#{not legalPersonHelper.editing}">
					<button
						onclick="#{rich:component('editLegalPersonDlg')}.hide();"
						type="button">
						#{messages['button.ok']}
					</button>
				</h:panelGroup>
			</div>
		</h:form>
	</rich:modalPanel>

</ui:composition>
